﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Warehouse_Management.New;

namespace Warehouse_Management
{
    public partial class frmNhapManager : DevExpress.XtraEditors.XtraForm
    {
        public frmNhapManager()
        {
            InitializeComponent();
        }
        public int status = 0;
        public List<PhieuGD> listPhieuGD = new List<PhieuGD>();
        private void frmNhapManager_Load(object sender, EventArgs e)
        {
        }
        public void loadData()
        {
            listPhieuGD = PhieuGD.LoadAll("LoaiPhieu = 'N'", "NgayNhap desc");
            gridControl1.DataSource = listPhieuGD;
            try
            { gridControl1.Refresh(); }
            catch
            { gridControl1.Refresh(); }
        }
        public void TaoMoi()
        {
            frmPhieuGiaoDich fN = new frmPhieuGiaoDich();
            fN.Text = "PHIẾU NHẬP";
            fN.Tag = TrangThaiChungTu.PhieuNhap;
            fN.ShowDialog(this);
            loadData();
        }
        public void seach(string condition)
        {
            string quyery = "LoaiPhieu = 'X'" + condition;
            listPhieuGD = PhieuGD.LoadAll(quyery, "NgayNhap desc");
            gridControl1.DataSource = listPhieuGD;
            try
            { gridControl1.Refresh(); }
            catch
            { gridControl1.Refresh(); }
        }
    }
}